#include <iostream>
#include <cstdio>
#include <string>
#include <stack>
using namespace std;
stack<int> aa;
int a, b, ans = 0, i = 1;
int main()
{
    cin >> a;
    if (a == 0)
    {
        cout << 0;
        return 0;
    }
    while (a > 0)
    {
        aa.push(a % 16);
        a = a / 16;
    }
    while (!aa.empty())
    {
        cout << aa.top();
        aa.pop();
    }
}